home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / 56000tar.z / 56000tar / 56000 / flts / iir2.hlp < prev    next >
Text File  |  1991-11-26  |  2KB  |  80 lines

  1. 2 IIR2
  2.          Name: IIR2.ASM
  3.          Type: Assembler Macro
  4.       Version: 1.0
  5.  Date Entered:  15-Jul-87
  6.   Last Change:  15-Jul-87
  7.  
  8.   Description: Direct Form Second Order All Pole Filter with Scaling
  9.  
  10.  This macro implements a second order all pole IIR filter. The
  11.  DSP56000/1 scaling modes are used to provide coefficient scaling.
  12.  This allows coefficients with magnitudes less than two.  This 
  13.  is similar in operation to the IIR1 macro.
  14.  
  15.  When the A or B register is read, the value is shifted
  16.  left such that the value of the filter state is multiplied by 2.
  17.  Since the coefficients are divided by two, the scale factors cancel.
  18.  This allows coefficients in filters to have magnitudes bounded by
  19.  2 which is typical of second order sections.
  20.  
  21.  The difference equation for the filter is:
  22.  
  23.  y(n)= 2 [x(n)  +  a(1)y(n-1)  +  a(2)y(n-2)]
  24.           ---      ----           ----
  25.            2        2               2
  26.  with z transform:
  27.  
  28.   Y(z)                1
  29.  ----- =  -------------------------
  30.   X(z)              -1           -2
  31.           1 - a(1) z     - a(2) z
  32.  
  33.  where:
  34.     x(n)  = input sample at time nT
  35.     y(n)  = output of the filter at time nT
  36.     a(n)  = filter coefficient n
  37.       T   = sample period
  38.  
  39.  
  40. An example network to realize such a filter is shown in below.
  41.  
  42.       Input
  43.     >----------(+)------------------------> Output
  44.    x(n)         ^              |          y(n)
  45.                 |     a(1)    1/z
  46.                (+)<-- 0.8 -----|
  47.                 ^              |
  48.                 |     a(2)    1/z
  49.                (+)<-- -0.3 ----|
  50.  
  51.       Second Order Direct Form All Pole IIR Filter
  52.  
  53.  The coefficients in the example are arbitrary. The memory
  54.  map for the filter is shown below:
  55.  
  56.              r0
  57.              |
  58.              v
  59.          --------------------
  60.     X:   |        |         |
  61.          | y(n-1) | y(n-2)  | Filter States
  62.          --------------------
  63.  
  64.          --------------------
  65.     Y:   |  a(1)  |   a(2)  |
  66.          |  .8/2  |  -.3/2  | Filter Coefficients
  67.          --------------------
  68.              ^
  69.              |
  70.              r4
  71.  
  72.         Memory Map for the Second Order All Pole Filter
  73.  
  74.  The modulo registers m0  and  m4  are  set  to  -1  for  linear
  75.  arithmetic.
  76.  
  77.  For an example of how to use this macro, see the test
  78.  program IIR2T.ASM
  79.  
  80.